package 实验.实验二;

public class Car {
    private String brand;
    private String model;
    private String color;
    private double renPrice;
    private boolean rented;
    public Car(String brand, String model, String color, double renPrice, boolean rented) {
        this.brand = brand;
        this.model = model;
        this.color = color;
        this.renPrice = renPrice;
        this.rented = false;
    }//有参构造方法
    public String getBrand(){
        return brand;
    }
    public String setBrand(String brand){
        this.brand = brand;
        return brand;
    }
    public String getModel() {
        return model;
    }
    public void setModel(String model) {
        this.model = model;
    }
    public String getColor() {
        return color;
    }
    public void setColor(String color) {
        this.color = color;
    }
    public double getRentPrice() {
        return renPrice;
    }
    public void setRenPrice(double renPrice) {
        this.renPrice = renPrice;
    }
    public boolean isRented() {
        return rented;
    }
    public void setRented(boolean rented) {
        this.rented = rented;
    }
    public void rent() {
        rented = true;
    }
    public void returnCar() {
        rented = false;
    }
}
